速報APP / 程式庫與試用程式 / React Native Maps Example

React Native Maps Example

價格:免費

更新日期:2017-06-27

檔案大小:7.7M

目前版本:1.0.1

版本需求:Android 4.1 以上版本

官方網站:mailto:hyperion4pps@gmail.com

React Native Maps Example(圖1)-速報App

React Native Maps Example for a Map component built by Airbnb that can use Apple Maps/Google Maps on iOS and Google Maps on Android.

https://github.com/airbnb/react-native-maps

1. MapView Events

The MapView component and its child components have several events that you can subscribe to.

2. Tracking Region / Location

3. Programmatically Changing Region

One can change the MapView position using refs and component methods, or by passing in an updated region prop. The component methods will allow one to animate to a given position like the native API could.

4. Changing the style of the map

React Native Maps Example(圖2)-速報App

5. Arbitrary React Views as Markers

6. Using the MapView with the Animated API

The MapView component can be made to work with the Animated API, having the entire region prop be declared as an animated value. This allows one to animate the zoom and position of the MapView along with other gestures, giving a nice feel. Further, Marker views can use the animated API to enhance the effect.

7. Polygon Creator

8. Other Overlays

So far, Circle, Polygon, and Polyline are available to pass in as children to the MapView component.

9. Default Markers

Default markers will be rendered unless a custom marker is specified. One can optionally adjust the color of the default marker by using the pinColor prop.

React Native Maps Example(圖3)-速報App

10. Custom Callouts

Callouts to markers can be completely arbitrary react views, similar to markers. As a result, they can be interacted with like any other view.

Additionally, you can fall back to the standard behavior of just having a title/description through the Marker's title and description props.

Custom callout views can be the entire tooltip bubble, or just the content inside of the system default bubble.

11. Image-based Markers

Markers can be customized by just using images, and specified using the image prop.

12. Draggable Markers

Markers are draggable, and emit continuous drag events to update other UI during drags.

React Native Maps Example(圖4)-速報App

13. Lite Mode ( Android )

Enable lite mode on Android with liteMode prop. Ideal when having multiple maps in a View or ScrollView.

14. Animated Region

The MapView can accept an MapView.AnimatedRegion value as its region prop. This allows you to utilize the Animated API to control the map's center and zoom.

15. Animated Marker Position

Markers can also accept an AnimatedRegion value as a coordinate.

16. Take Snapshot of map

17. Zoom to Specified Markers

React Native Maps Example(圖5)-速報App

Pass an array of marker identifiers to have the map re-focus.

18. Zoom to Specified Coordinates

Pass an array of coordinates to focus a map region on said coordinates.

React Native Maps Example(圖6)-速報App